//display pv digits
var pseg_0 = new Image();
pseg_0.src = "pngs/seg_0.png";
var pseg_1 = new Image();
pseg_1.src = "pngs/seg_1.png";
var pseg_2 = new Image();
pseg_2.src = "pngs/seg_2.png";
var pseg_3 = new Image();
pseg_3.src = "pngs/seg_3.png";
var pseg_4 = new Image();
pseg_4.src = "pngs/seg_4.png";
var pseg_5 = new Image();
pseg_5.src = "pngs/seg_5.png";
var pseg_6 = new Image();
pseg_6.src = "pngs/seg_6.png";
var pseg_7 = new Image();
pseg_7.src = "pngs/seg_7.png";
var pseg_8 = new Image();
pseg_8.src = "pngs/seg_8.png";
var pseg_9 = new Image();
pseg_9.src = "pngs/seg_9.png";
//end pv dsp preload
//display sp digits
var sseg_0 = new Image();
sseg_0.src = "pngs/dig_0.png";
var sseg_1 = new Image();
sseg_1.src = "pngs/dig_1.png";
var sseg_2 = new Image();
sseg_2.src = "pngs/dig_2.png";
var sseg_3 = new Image();
sseg_3.src = "pngs/dig_3.png";
var sseg_4 = new Image();
sseg_4.src = "pngs/dig_4.png";
var sseg_5 = new Image();
sseg_5.src = "pngs/dig_5.png";
var sseg_6 = new Image();
sseg_6.src = "pngs/dig_6.png";
var sseg_7 = new Image();
sseg_7.src = "pngs/dig_7.png";
var sseg_8 = new Image();
sseg_8.src = "pngs/dig_8.png";
var sseg_9 = new Image();
sseg_9.src = "pngs/dig_9.png";
//end pv dsp preload
var spcolon_1 = new Image();
spcolon_1.src = "pngs/sp-colon-on.png";
var spcolon_0 = new Image();
spcolon_0.src = "pngs/sp-colon-off.png";
//
var colon_1 = new Image();
colon_1.src = "pngs/colon_on.png";
var colon_0 = new Image();
colon_0.src = "pngs/colon_off.png";
//
var ampm_1 = new Image();
ampm_1.src = "pngs/am.png";
var ampm_2 = new Image();
ampm_2.src = "pngs/pm.png";
var ampm_3 = new Image();
ampm_3.src = "pngs/ampm.png";
//
var setap_1 = new Image();
setap_1.src = "pngs/am-s.png";
var setap_2 = new Image();
setap_2.src = "pngs/pm-s.png";
var setap_3 = new Image();
setap_3.src = "pngs/am-pm.png";
//
var set_1 = new Image();
set_1.src = "pngs/set-on.png";
var set_0 = new Image();
set_0.src = "pngs/set-off.png";
var sel_1 = new Image();
sel_1.src = "pngs/sel-on.png";
var sel_0 = new Image();
sel_0.src = "pngs/sel-off.png";
var inc_1 = new Image();
inc_1.src = "pngs/inc-on.png";
var inc_0 = new Image();
inc_0.src = "pngs/inc-off.png";
// seconds display
var sp_0 = 0;
var sp_1 = 0;
//
var al_1 = 0;  // alarm digit
var al_2 = 0;
var al_3 = 0;
var al_4 = 0;
//
var alm1 =360;
var alm2 =540;
var alm3 =60;
var alm4 =240;
var alm5 =540;
var als1 =2; // sounds
var als2 =4;
var als3 =6;
var als4 =8;
var als5 =3;
var al5_note = "Alarm-5";
var al4_note = "Alarm-4";
var al3_note = "Alarm-3";
var al2_note = "Alarm-2";
var al1_note = "Alarm-1";
var set_ap1 ="am";
var set_ap2 ="am";
var set_ap3 ="pm";
var set_ap4 ="pm";
var set_ap5 ="pm";
//
var set_ap ="am";
var rem_mts =0;
var curr_alm;
var alm_ring;
var note_temp;
var sound_temp;
var alm_count = 1;
var alarm_state =0;
var alm_once=0;
var alm_day=0;
var mus_count=0;
var alm_sound ="38642" ; // als1 + als2 ..
//
var status_time;
var am_pm;
var time_now;
var day_now ;
var month_now ;
var year_now ;
var hours_now;
var mins_now;
var secs_now;
var msec_now;
var wday_now;
var week_day;
var curr_month;
var week_num;
//
var sel_digit = 0;
var marky = 102;
var set_state =0;
var sel_state =0;
var inc_state =0;
var timer_pv =0;
var timer_sp=0;
var mus_state=0;
//
var set_live; // set auto off
var dir_flag=0;
//
var base_time=1000;
var up;
var min1=0;
var min2=0;
var hur1=0;
var hur2=0;
//
var save_but = new Image();
save_but.src = "pngs/save.png";
var done_but = new Image();
done_but.src = "pngs/done.png";
//
function show_clock(){
dsp_test();
show_mem();
}
//
function dsp_test(){
document.images.pvdsp4.src = pseg_8.src;
document.images.pvdsp3.src = pseg_8.src;
document.images.pvdsp2.src = pseg_8.src;
document.images.pvdsp1.src = pseg_8.src;
document.images.spdsp1.src = sseg_8.src;
document.images.spdsp0.src = sseg_8.src;
document.images.colon_sec.src = colon_1.src;
document.images.aldsp4.src = sseg_8.src;
document.images.aldsp3.src = sseg_8.src;
document.images.aldsp2.src = sseg_8.src;
document.images.aldsp1.src = sseg_8.src;
document.images.spcolon.src = spcolon_1.src;
document.images.almno.src = sseg_8.src;
document.images.am_pm.src = ampm_3.src;
show_text(1,'status_box');
window.setTimeout("dsp_rst();",5000);
}
//
function dsp_rst(){
document.images.pvdsp4.src = pseg_0.src;
document.images.pvdsp3.src = pseg_0.src;
document.images.pvdsp2.src = pseg_0.src;
document.images.pvdsp1.src = pseg_0.src;
document.images.spdsp1.src = sseg_0.src;
document.images.spdsp0.src = sseg_0.src;
document.images.colon_sec.src = colon_0.src;
document.images.aldsp4.src = sseg_0.src;
document.images.aldsp3.src = sseg_0.src;
document.images.aldsp2.src = sseg_0.src;
document.images.aldsp1.src = sseg_0.src;
document.images.spcolon.src = spcolon_1.src;
document.images.almno.src = sseg_0.src;
clock_start();
}
//
// Online Help Start
//adapted from Link Description script- www.dynamicdrive.com
var linktext=new Array()
linktext[0]=""
linktext[1]="Display<br>Test"
linktext[2]="<form name='show_alm' action=''><input readonly='readonly' name='read_msg' size='10' value='" + al1_note + "' type='text'><input align='top' onclick='rst_alm();' alt='Ok' title='Ok' type='image' src='pngs/done.png'></form>"
linktext[3]="Tomorrow<br>Again"
linktext[4]="<form name='take_alm' action=''><input class='alm_type' name='take_msg' maxlength='30' size='12' value='" + al1_note + "' type='text'><input align='top' onclick='save_alm();' alt='Save' title='Save' type='image' src='pngs/save.png'></form>"
linktext[5]=""
//
var ns6=document.getElementById&&!document.all
var ie=document.all

function show_text(thetext, whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}

function resetit(whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=' '
else if (ns6) document.getElementById(whichdiv).innerHTML=' '
}
//  Online Help End
//
//date-time
//
function get_time() {
time_now = new Date();
wday_now = time_now.getDay() + 1;
msec_now = time_now.getTime();
day_now = time_now.getDate();
month_now = time_now.getMonth() + 1;
year_now = time_now.getFullYear();
hours_now = time_now.getHours();
mins_now = time_now.getMinutes();
secs_now = time_now.getSeconds();
if (mins_now < 10)
{
min1 = mins_now;
min2 = 0;
}
else
{
min2 = parseInt(mins_now/10);
min1 = mins_now - (min2 * 10);
}
if (secs_now < 10)
{
sp_0 = secs_now;
sp_1 = 0;
}
else
{
sp_1 = parseInt(secs_now/10);
sp_0 = secs_now - (sp_1 * 10);
}
if(hours_now > 11)
{
am_pm = "pm";
document.images.am_pm.src = ampm_2.src;
}
else
{
am_pm = "am";
document.images.am_pm.src = ampm_1.src;
}
if (hours_now < 10 && hours_now > 0 )
{
hur1 = hours_now;
hur2 = 0;
}
else if (hours_now == 0)
{
hur1 = 2;
hur2 = 1;
}
else if ( hours_now > 12)
{
hours_now =  hours_now - 12;
hur2 = parseInt(hours_now/10);
hur1 = hours_now - (hur2 * 10);
}
else
{
hur2 = parseInt(hours_now/10);
hur1 = hours_now - (hur2 * 10);
}
//week days
switch(wday_now){
case 1:
week_day="Sun";
break;
case 2:
week_day="Mon";
break;
case 3:
week_day="Tue";
break;
case 4:
week_day="Wed";
break;
case 5:
week_day="Thu";
break;
case 6:
week_day="Fri";
break;
case 7:
week_day="Sat";
break;
}
//
//month
switch(month_now){
case 1:
curr_month="Jan";
break;
case 2:
curr_month="Feb";
break;
case 3:
curr_month="Mar";
break;
case 4:
curr_month="Apr";
break;
case 5:
curr_month="May";
break;
case 6:
curr_month="Jun";
break;
case 7:
curr_month="Jul";
break;
case 8:
curr_month="Aug";
break;
case 9:
curr_month="Sep";
break;
case 10:
curr_month="Oct";
break;
case 11:
curr_month="Nov";
break;
case 12:
curr_month="Dec";
break;
}
//
get_wn();
//
status_time = day_now + " " + week_day + " " + "Week " + week_num + "<br>" + curr_month + " " + year_now;
linktext[0]=  status_time ;
update_digits();
if (alarm_state == 0 && set_state == 0 ){
show_text(0,'status_box');
}
}
//
// adapted from week number  www.quirksmode.org/js/week.html
function get_wn() {
 	var today = new Date();
	Year = takeYear(today);
	Month = today.getMonth();
	Day = today.getDate();
	now = Date.UTC(Year,Month,Day+1,0,0,0);
	var Firstday = new Date();
	Firstday.setYear(Year);
	Firstday.setMonth(0);
	Firstday.setDate(1);
	then = Date.UTC(Year,0,1,0,0,0);
	var Compensation = Firstday.getDay();
	if (Compensation > 3) Compensation -= 4;
	else Compensation += 3;
	week_num =  Math.round((((now-then)/86400000)+Compensation)/7);
}
//
//
function takeYear(theDate)
{
 x = theDate.getYear();
 var y = x % 100;
 y += (y < 38) ? 2000 : 1900;
 return y;
}
//  quirksmode week end
//
//
//1 Sec Clock timer
function clock_start() {
document.images.colon_sec.src = colon_1.src;
up=setTimeout("colon_off();",(base_time/2));
}
function colon_off() {
document.images.colon_sec.src = colon_0.src;
up=setTimeout("clock_start();",(base_time/2));
get_time();
}
//end sec clock
//
//display sp
function dsp_sp() {
document.images.aldsp4.src = "pngs/dig_" + al_4 + ".png";
document.images.aldsp3.src = "pngs/dig_" + al_3 + ".png";
document.images.aldsp2.src = "pngs/dig_" + al_2 + ".png";
document.images.aldsp1.src = "pngs/dig_" + al_1 + ".png";
document.images.ampm_set.src = "pngs/" + set_ap + "-s.png";
document.images.almno.src = "pngs/dig_" + alm_count + ".png";
}
//
//display pv
function dsp_pv() {
document.images.pvdsp1.src = "pngs/seg_" + min1 + ".png";
document.images.pvdsp2.src = "pngs/seg_" + min2 + ".png";
document.images.pvdsp3.src = "pngs/seg_" + hur1 + ".png";
document.images.pvdsp4.src = "pngs/seg_" + hur2 + ".png";
document.images.spdsp0.src = "pngs/dig_" + sp_0 + ".png";
document.images.spdsp1.src = "pngs/dig_" + sp_1 + ".png";
}
//
function rec_sp() {
document.images.aldsp4.src = "pngs/dig_" + al_4 + ".png";
document.images.aldsp3.src = "pngs/dig_" + al_3 + ".png";
document.images.aldsp2.src = "pngs/dig_" + al_2 + ".png";
document.images.aldsp1.src = "pngs/dig_" + al_1 + ".png";
document.images.ampm_set.src = "pngs/" + set_ap + "-s.png";
createCookie('digitalclock1delabs2al1t',alm1,999);
createCookie('digitalclock1delabs2al2t',alm2,999);
createCookie('digitalclock1delabs2al3t',alm3,999);
createCookie('digitalclock1delabs2al4t',alm4,999);
createCookie('digitalclock1delabs2al5t',alm5,999);
createCookie('digitalclock1delabs2al1a',set_ap1,999);
createCookie('digitalclock1delabs2al2a',set_ap2,999);
createCookie('digitalclock1delabs2al3a',set_ap3,999);
createCookie('digitalclock1delabs2al4a',set_ap4,999);
createCookie('digitalclock1delabs2al5a',set_ap5,999);
}
//
function update_digits() {
dsp_pv();
sp_pv();
}
//end of digital clock
//
//begin of alarm clock
//
function set_toggle(){
if (set_state==0){
set_state=1;
document.images.setbut.src = set_1.src;
sp_flash();
alm_once = 0;
createCookie('digitalclock1delabs2alao',alm_once,1);
set_live = window.setTimeout("set_off();",120000);
}
else if (set_state==1)
{
scroll_alarm();
}
read_alarm();
dsp_sp();
sound5Play(beep_sound);
linktext[4]="<form name='take_alm' action=''><input  maxlength='30' class='alm_type' name='take_msg' size='12' value='" + note_temp + "' type='text'><img align='top' onclick='save_alm();' alt='Save' title='Save' src='pngs/save.png'></form>"
show_text(4,'status_box');
}
//
function set_off(){
document.images.setbut.src = set_0.src;
marker.style.visibility = "hidden";
clearTimeout(sp_cup);
set_state=0;
document.images.spcolon.src = spcolon_1.src;
sound5Play(dial_tone);
}
//end Set on-off
//
function scroll_alarm(){
if (alm_count < 5 ){
alm_count++;
}
else
{
alm_count = 1;
}
document.images.almno.src = "pngs/dig_" + alm_count + ".png";
}
//
//
function sel_toggle(){
if (set_state==1 && sel_state ==0){
sel_state = 1;
sound5Play(beep_sound);
document.images.selbut.src = sel_1.src;
marker.style.visibility = "visible";
if (sel_digit < 5 && dir_flag == 0)
{
sel_digit++;
if(sel_digit == 5){dir_flag=1;}
}
else if (sel_digit > 1 && dir_flag == 1)
{
sel_digit--;
if(sel_digit == 1){dir_flag=0;}
}
window.setTimeout("sel_off();",200);
}
}
//
function sel_off(){
marker.style.left = marky - (18 * sel_digit) + "px";
document.images.selbut.src = sel_0.src;
sel_state = 0;
}
//
var sp_cup;
//sp Colon flash
function sp_flash() {
document.images.spcolon.src = spcolon_1.src;
sp_cup=setTimeout("spcolon_off();",200);
}
function spcolon_off() {
document.images.spcolon.src = spcolon_0.src;
sp_cup=setTimeout("sp_flash();",200);
}
//
//
function inc_toggle(){
if (set_state==1 && inc_state ==0){
inc_state = 1;
sound5Play(beep_sound);
document.images.incbut.src = inc_1.src;
window.setTimeout("inc_off();",200);
}
}
//
function inc_off(){
scroll_it();
document.images.incbut.src = inc_0.src;
inc_state = 0;
}
//
function scroll_it(){
switch (sel_digit){
case 1:
if (al_1 < 9){al_1++}
else al_1 = 0;
break;
case 2:
if (al_2 < 5){al_2++}
else al_2 = 0;
break;
case 3:
if ((al_4 < 1 && al_3 < 9)||(al_4 == 1 && al_3 < 2) ){al_3++}
else al_3 = 0;
break;
case 4:
if (al_4 < 1 && al_3 < 3){al_4++}
else al_4 = 0;
break;
case 5:
if (set_ap == "am"){set_ap = "pm"}
else set_ap = "am";
break;
}
store_alarm();
rec_sp();
}
//
function store_alarm(){
switch (alm_count){
case 1:
alm1 = (al_4 * 600) + (al_3 * 60) + (al_2 * 10) + (al_1 * 1); //mts
set_ap1 = set_ap;
break;
case 2:
alm2 = (al_4 * 600) + (al_3 * 60) + (al_2 * 10) + (al_1 * 1); //mts
set_ap2 = set_ap;
break;
case 3:
alm3 = (al_4 * 600) + (al_3 * 60) + (al_2 * 10) + (al_1 * 1); //mts
set_ap3 = set_ap;
break;
case 4:
alm4 = (al_4 * 600) + (al_3 * 60) + (al_2 * 10) + (al_1 * 1); //mts
set_ap4 = set_ap;
break;
case 5:
alm5 = (al_4 * 600) + (al_3 * 60) + (al_2 * 10) + (al_1 * 1); //mts
set_ap5 = set_ap;
break;
}
}
//
//
function read_alarm(){
switch (alm_count){
case 1:
curr_alm = alm1;
note_temp = al1_note;
set_ap = set_ap1;
break;
case 2:
curr_alm = alm2;
note_temp = al2_note;
set_ap = set_ap2;
break;
case 3:
curr_alm = alm3;
note_temp = al3_note;
set_ap = set_ap3;
break;
case 4:
curr_alm = alm4;
note_temp = al4_note;
set_ap = set_ap4;
break;
case 5:
curr_alm = alm5;
note_temp = al5_note;
set_ap = set_ap5;
break;
}
digits_load();
}
//
//compares set point and process value
function sp_pv() {
if (set_state==0){
timer_pv = (hur2 * 600) + (hur1 * 60) + (min2 * 10) + (min1 * 1); //mts
if (timer_pv >= alm1 && timer_pv < (alm1 + 200) && am_pm == set_ap1){sound_alarm(1);}
if (timer_pv >= alm2 && timer_pv < (alm2 + 200) && am_pm == set_ap2){sound_alarm(2);}
if (timer_pv >= alm3 && timer_pv < (alm3 + 200) && am_pm == set_ap3){sound_alarm(3);}
if (timer_pv >= alm4 && timer_pv < (alm4 + 200) && am_pm == set_ap4){sound_alarm(4);}
if (timer_pv >= alm5 && timer_pv < (alm5 + 200) && am_pm == set_ap5){sound_alarm(5);}
}
}
//
//
//speaker Alarm
function sound_alarm(alm_ring){
if (alarm_state == 0 && set_state == 0){
alm_count = alm_ring;
switch (alm_ring){
case 1:
if ((alm_once & 2) ==0){
note_temp = al1_note;
sound_temp =eval("alm" + als1 + "_song");
play_alm();
}
alm_once = alm_once | 2;
break;
case 2:
if ((alm_once & 4) ==0){
note_temp = al2_note;
sound_temp = eval("alm" + als2 + "_song");
play_alm();
}
alm_once = alm_once | 4;
break;
case 3:
if ((alm_once & 8) ==0){
note_temp = al3_note;
sound_temp = eval("alm" + als3 + "_song");
play_alm();
}
alm_once = alm_once | 8;
break;
case 4:
if ((alm_once & 16) ==0){
note_temp = al4_note;
sound_temp = eval("alm" + als4 + "_song");
play_alm();
}
alm_once = alm_once | 16;
break;
case 5:
if ((alm_once & 32) ==0){
note_temp = al5_note;
sound_temp = eval("alm" + als5 + "_song");
play_alm();
}
alm_once = alm_once | 32;
break;
}
createCookie('digitalclock1delabs2alao',alm_once,9);
alm_day = day_now;
createCookie('digitalclock1delabs2alad',alm_day,9);
}
}
//
function play_alm() {
alarm_state = 1;
read_alarm();
dsp_sp();
sound5Play(sound_temp);
linktext[2]="<form name='show_alm' action=''><input readonly='readonly' class='alm_show' name='read_msg' size='12' value='" + note_temp + "' type='text'><img align='top' onclick='rst_alm();' alt='Ok' title='Ok' src='pngs/done.png'></form>"
show_text(2,'status_box');
}
//
function rst_alm() {
if (alarm_state == 1){
window.setTimeout("alm_rst();",7000);
show_text(3,'status_box');
sound5Stop();
}
}
//
function alm_rst() {
alarm_state = 0;
}
//end of alarm clock
//
//check cookies enabled
function show_mem() {
createCookie('xyztest8abc', 'san',1);
if (readCookie('xyztest8abc') == 'san'){
prime_mem();
}
else {
al1_note = "On Cookies !";
sound_alarm(1);
}
}
//
function prime_mem() {
if (readCookie('digitalclock1delabs2al1t')){
read_mem();
}
else {
createCookie('digitalclock1delabs2al1t',alm1,999);
createCookie('digitalclock1delabs2al2t',alm2,999);
createCookie('digitalclock1delabs2al3t',alm3,999);
createCookie('digitalclock1delabs2al4t',alm4,999);
createCookie('digitalclock1delabs2al5t',alm5,999);
createCookie('digitalclock1delabs2al1a',set_ap1,999);
createCookie('digitalclock1delabs2al2a',set_ap2,999);
createCookie('digitalclock1delabs2al3a',set_ap3,999);
createCookie('digitalclock1delabs2al4a',set_ap4,999);
createCookie('digitalclock1delabs2al5a',set_ap5,999);
createCookie('digitalclock1delabs2al1n',al1_note,999);
createCookie('digitalclock1delabs2al2n',al2_note,999);
createCookie('digitalclock1delabs2al3n',al3_note,999);
createCookie('digitalclock1delabs2al4n',al4_note,999);
createCookie('digitalclock1delabs2al5n',al5_note,999);
createCookie('digitalclock1delabs2alas',alm_sound,999);
createCookie('digitalclock1delabs2alao',alm_once,1);
createCookie('digitalclock1delabs2alad',alm_day,9);
}
}
//end check
function read_mem() {
if (readCookie('digitalclock1delabs2al1t')){
alm1 = parseInt(readCookie('digitalclock1delabs2al1t'));
alm2 = parseInt(readCookie('digitalclock1delabs2al2t'));
alm3 = parseInt(readCookie('digitalclock1delabs2al3t'));
alm4 = parseInt(readCookie('digitalclock1delabs2al4t'));
alm5 = parseInt(readCookie('digitalclock1delabs2al5t'));
al1_note = readCookie('digitalclock1delabs2al1n');
al2_note = readCookie('digitalclock1delabs2al2n');
al3_note = readCookie('digitalclock1delabs2al3n');
al4_note = readCookie('digitalclock1delabs2al4n');
al5_note = readCookie('digitalclock1delabs2al5n');
set_ap1 = readCookie('digitalclock1delabs2al1a');
set_ap2 = readCookie('digitalclock1delabs2al2a');
set_ap3 = readCookie('digitalclock1delabs2al3a');
set_ap4 = readCookie('digitalclock1delabs2al4a');
set_ap5 = readCookie('digitalclock1delabs2al5a');
//
if (readCookie('digitalclock1delabs2alao')){
alm_once = parseInt(readCookie('digitalclock1delabs2alao'));
alm_day = parseInt(readCookie('digitalclock1delabs2alad'));
}
//
if (readCookie('digitalclock1delabs2alas')){
alm_sound = readCookie('digitalclock1delabs2alas');
als1 =  alm_sound.charAt(4);
als2 =  alm_sound.charAt(3);
als3 =  alm_sound.charAt(2);
als4 =  alm_sound.charAt(1);
als5 =  alm_sound.charAt(0);
}
//
curr_alm = alm1;
digits_load();
clear_day();
}
}
//
function clear_day() {
time_now = new Date();
day_now = time_now.getDate();
if (alm_day != day_now){
alm_once = 0;
createCookie('digitalclock1delabs2alao',alm_once,1);
}
}
//
//alm0 digit values for display  al_1 ..
function digits_load(){
al_4= parseInt(curr_alm/600);
al_3= parseInt((curr_alm/60)-(al_4*10));
rem_mts = curr_alm -((al_4*600) + (al_3*60));
al_2= parseInt(rem_mts/10);
al_1= parseInt(rem_mts -(al_2*10));
}
//
var note_tmps;
//
function save_alm(){
note_tmps = document.take_alm.take_msg.value;
switch (alm_count){
case 1:
al1_note = note_tmps;
createCookie('digitalclock1delabs2al1n',note_tmps,999);
mus_count = als1;
break;
case 2:
al2_note = note_tmps;
createCookie('digitalclock1delabs2al2n',note_tmps,999);
mus_count = als2;
break;
case 3:
al3_note = note_tmps;
createCookie('digitalclock1delabs2al3n',note_tmps,999);
mus_count = als3;
break;
case 4:
al4_note = note_tmps;
createCookie('digitalclock1delabs2al4n',note_tmps,999);
mus_count = als4;
break;
case 5:
al5_note = note_tmps;
createCookie('digitalclock1delabs2al5n',note_tmps,999);
mus_count = als5;
break;
}
linktext[0]="&nbsp;Music&nbsp;<img align='middle' name='mus_dsp' src='pngs/dig_" + mus_count +".png'>&nbsp;&nbsp;<img align='middle' onclick='mus_set();' name='musbut' alt='Scroll' title='Scroll' src='pngs/inc-off.png' >";
show_text(0,'status_box');
sound_temp =  eval("alm" + mus_count + "_song");
sound5Play(sound_temp);
}
//
function mus_scroll(){
if (mus_count < 9 ){
mus_count++;
}
else
{
mus_count = 0;
}
document.images.mus_dsp.src = "pngs/dig_" + mus_count + ".png";
sound_temp =  eval("alm" + mus_count + "_song");
sound5Play(sound_temp);
switch (alm_count){
case 1:
als1 = mus_count;
break;
case 2:
als2 = mus_count;
break;
case 3:
als3 = mus_count;
break;
case 4:
als4 = mus_count;
break;
case 5:
als5 = mus_count;
break;
}
alm_sound = als5.toString() + als4.toString() + als3.toString() + als2.toString() + als1.toString();
createCookie('digitalclock1delabs2alas',alm_sound,999);
}
//
function mus_set(){
if (set_state==1 && mus_state ==0){
mus_state = 1;
sound5Play(beep_sound);
document.images.musbut.src = inc_1.src;
window.setTimeout("mus_off();",200);
}
}
//
function mus_off(){
mus_scroll();
document.images.musbut.src = inc_0.src;
mus_state = 0;
}
//
window.onload=show_clock;
//
//end of script